home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
L' Effet Pommier 3
/
L'Effet Pommier - Volume 03.iso
/
Graphismes
/
3D
/
POV-Ray 3.0B5a PPC
/
POV-Ray 3.0B5a
/
POVRAY.PPC Application
/
POV-Ray 3 Templates
< prev
next >
Wrap
Text File
|
1996-02-11
|
41KB
|
1,317 lines
@com.POV-Ray 3 Macintosh Template file
@com.Version: 3.0 beta 3
@com.Last Modified: September 27, 1995 [esp]
@com. December 28, 1995 [anr]
@com.------------------------------------------------------------
@com.NOTE: Look for "FIXME" string for incomplete sections
@com.============================================================
@mt1.Statements
@com.============================================================
@com.------------------------------
@mt2.background
// Set a color of the background (sky)
background { color red 0.1 green 0.3 blue 0.8 }
@mt2.camera
// set viewer's position in the scene
camera
{
// (camera types)
// perspective (default) | orthographic | fisheye |
// ultra_wide_angle | omnimax | panoramic | cylinder 1
location <0.0, 1.0, -6.0> // position of camera <X Y Z>
direction 2.0*z // which way are we looking <X Y Z> & zoom
// sky y // rarely used
up y // which way is +up <X Y Z>
right 4/3*x // which way is +right <X Y Z> and aspect ratio
look_at <0.0, 0.0, 0.0> // point center of view at this point <X Y Z>
// angle FLOAT // overrides "direction" with specific angle
// normal { ripples 0.2 } // perturb the camera lens with a pattern
// (focal blur extras)
// aperture 0.2 // 0...N (bigger is narrower depth of field)
// blur_samples 4 // # of rays per pixel
// focal_point <VECTOR> // x,y,z point that is in focus
}
@com.------------------------------
@mt2.Fog
//FIXME
// set global atmospheric fog effect in the scene.
// at the fog distance, there will be 63% visibility
fog {
fog_type 1 // 1=constant, 2=ground_fog
distance 10
color Gray
// turbulence <TURBULENCE>
// turb_depth TURB_DEPTH
// omega OMEGA
// lambda LAMBDA
// octaves OCTAVES
// fog_offset FOG_OFFSET
// fog_alt FOG_ALT
}
@com.------------------------------
@mt2.Rainbow
//FIXME
rainbow {
direction <DIR>
angle ANGLE
width WIDTH
distance DISTANCE
color_map { COLOUR_MAP }
[ jitter JITTER ]
[ up <UP> ]
[ arc_angle ARC_ANGLE ]
[ falloff_angle FALLOFF_ANGLE ]
}
@com.------------------------------
@mt2.Sky Sphere
//FIXME
sky_sphere
{
}
@com.------------------------------
@mt2.adc
global_settings { adc_bailout 20 }
@com.------------------------------
@mt2.assumed gamma
global_settings { assumed_gamma 1.0 }
@com.------------------------------
@mt2.HFGray16
global_settings { HF_Gray_16 }
@com.------------------------------
@mt2.irid_wavelength
global_settings { irid_wavelength <0.25, 0.18, 14> }
@com.------------------------------
@mt2.max_trace_level
global_settings { max_trace_level 20 }
@com.------------------------------
@mt2.max_intersections
global_settings { max_intersections 200 }
@com.------------------------------
@mt2.number_of_waves
global_settings { number_of_waves 10 }
@com.------------------------------
@mt2.ambient light
global_settings { ambient_light { color <COLOR> } }
@com.------------------------------
@mt2.standard includes
// ==== Standard POV-Ray Includes ====
#include "colors.inc" // Standard Color definitions
#include "textures.inc" // Standard Texture definitions
@com.------------------------------
@mt2.additional includes
// ==== Additional Includes ====
#include "CHARS.INC // FIXME-add comments describing each of these
#include "CONSTS.INC
#include "METALS.INC
#include "SHAPES.INC
#include "SHAPES2.INC
#include "SHAPESQ.INC
#include "SKIES.INC
#include "STONES.INC
#include "STONES2.INC
#include "WOODMAPS.INC
#include "WOODS.INC
@com.------------------------------
@mt2.max_intersections
// set the maximum ray tracing intersection depth (1...200) [64]
#max_intersections 64
@com.------------------------------
@mt2.max_trace_level
// set the maximum ray tracing bounce depth (1...20) [5]
#max_trace_level 5
@com.------------------------------
@mt2.Scene file header
// Persistence of Vision Ray Tracer Scene Description File
// File: ?.pov
// Vers: 3
// Desc: ?
// Date: mm/dd/yy
// Auth: ?
//
@com.------------------------------
@mt2.version
// Set the language version of POV-Ray. Enables or
// disables syntax features that are version-dependent.
// e.g. #version 1.0, or #version 2.0, etc.
// (Note: This can toggle versions anywhere in the source)
#version 2.0 // use POV-Ray 2.0 syntax
@com.============================================================
@mt1.Animation
@com.============================================================
@com.------------------------------
// FIXME-fill in an example with clock
@com.============================================================
@mt1.Expressions
@com.============================================================
@com.------------------------------
@mt2.Built-in Ids
// These identifiers are built in to POV-Ray, ready to use
// #declare pi = 3.1415926535897932384626
// #declare true = 1
// #declare yes = 1
// #declare on = 1
// #declare false = 0
// #declare no = 0
// #declare off = 0
// #declare u = <1,0>
// #declare v = <0,1>
// #declare x = <1,0,0>
// #declare y = <0,1,0>
// #declare z = <0,0,1>
// #declare t = <0,0,0,1>
@com.------------------------------
@mt2.Math Operators
// () * / + - !
#declare MyResult = -2*B + (A*A - 4)
@mt2.Relational Operators
// Relationals must be within parentheses
// Return arithmetic value 0 for false or 1 for true
// < <= = != >= >
#declare BallColor = pigment { red (clock > 0.5) } // black or red
@com.------------------------------
@mt2.Vector components
// extract each component of a vector:
// #if (MyVector.x > 5) ...
// #if (MyVector.y > 5) ...
// #if (MyVector.z > 5) ...
// #if (MyVector.t > 5) ...
@com.------------------------------
@mt2.Strings
/* various string operations
asc(S1) // Convert 1st character of S1 to ASCII value
chr(A) // Convert extended ASCII value A to a 1 character string
concat(S1,S2) // combine S1 and S2 into one long string
file_exists(S1): Search current and include directories for existence of file S1 (0 or 1)
str(A,L,P) // Convert float A to string, at least L characters long,
// with P digits after the decimal point (if P is -1, make max)
strcmp(S1,S2) // compare S1 to S2, return -1, 0, or +1 if S2 is <, =, > than S1
strlen(S1) // Returns # of characters in string S1
strlwr(S1) // Lower case of S1
substr(S1,P,L) // Sub-string from S1, start at position P for length L
strupr(S1) // Upper case of S1
val(S1) // Convert string S1 to float
// some special characters that can be used within strings
"\a" Bell or alarm, 0x07
"\b" Backspace, 0x08
"\f" Form feed, 0x0C
"\n" New line (line feed) 0x0A
"\r" Carriage return 0x0D
"\t" Horizontal tab 0x09
"\v" Vertical tab 0x0B
"\0" Null 0x00
"\\" Backslash 0x5C
"\'" Single quote 0x27
*/
@com.============================================================
@mt1.Light sources
@com.============================================================
@com.------------------------------
@mt2.General light definition
/*
light_source
{
<CENTER>
color <COLOUR>
[ spotlight ]
[ cylinder ]
[ point_at <POINT> ]
[ radius RADIUS ]
[ falloff FALLOFF ]
[ tightness TIGHTNESS ]
[ area_light <AXIS1>, <AXIS2>, SIZE1, SIZE2 ]
[ adaptive ADAPTIVE ]
[ jitter JITTER ]
[ looks_like { OBJECT } ]
[ fade_distance FADE_DISTANCE ]
[ fade_power FADE_POWER ]
[ atmospheric_attenuation BOOL ]
[ shadowless ]
}
*/
@com.------------------------------
@mt2.Point light
// create a regular point light source
light_source
{
0*x // light's position (translated below)
color red 1.0 green 1.0 blue 1.0 // light's color
translate <-20, 40, -20>
}
@com.------------------------------
@mt2.Spotlight
// create a point "spotlight" (directed) light source
light_source
{
0*x // light's position (translated below)
color red 1.0 green 1.0 blue 1.0 // light's color
spotlight // this kind of light source
translate <40, 80, -40> // <x y z> position of light
point_at <0, 0, 0> // direction of spotlight
radius 5 // hotspot (inner, in degrees)
tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter
falloff 8 // intensity falloff radius (outer, in degrees)
}
@com.------------------------------
@mt2.looks_like
// create a regular point light source
light_source
{
0*x // light's position (translated below)
color rgb 1.0 // light's color
// uncomment the next line to give the light source a visible appearance
// looks_like { sphere { 0*x, 5 pigment { Yellow } } }
translate <-20, 40, -20>
}
@com.------------------------------
@mt2.area light
// An extended area light (soft shadows)
// WARNING: This can significantly slow down rendering times!
light_source
{
0*x // light's position (translated below)
color rgb 1.0 // light's color
// <widthVector> <heightVector> nLightsWide mLightsHigh
area_light <8, 0, 0> <0, 8, 0> 4, 4
adaptive 0 // 0,1,2,3...
jitter // adds random softening of light
translate <40, 80, -40> // <x y z> position of light
}
@com.============================================================
@mt1.Misc. Directives
@com.============================================================
@com.------------------------------
@mt2.atmosphere
//FIXME
/*
#declare ISOTROPIC_SCATTERING = 1
#declare MIE_HAZY_SCATTERING = 2
#declare MIE_MURKY_SCATTERING = 3
#declare RAYLEIGH_SCATTERING = 4
#declare HENYEY_GREENSTEIN_SCATTERING = 5
atmosphere {
type SCATTERING_TYPE
distance DISTANCE
[ scattering SCATTERING ]
[ eccentricity ECCENTRICITY ]
[ samples SAMPLES ]
[ jitter JITTER ]
[ aa_threshold AA_THRESHOLD ]
[ aa_level AA_LEVEL ]
[ color <COLOUR> ]
}
*/
// Atmosphere with Mie scattering, murky atmosphere (dependent on incident light).
atmosphere
{
type 3 // Mie scattering
samples 20 // Number of samples in first distance interval
distance 20 // Atmosphere density, similar to fog
scattering 1.5 // Reflectivity of atmosphere, determines brightness
aa_level 8 // Level of binary subdivision in case of aa
aa_threshold 0.1 // Threshold for aa to push in
jitter 0.2 // Amount of sample jittering
}
@com.------------------------------
@mt2.declare
#declare MyColor = color red 0.7 green 0.5 blue 0.3
@com.------------------------------
@mt2.default
// sets the default texture that objects get when they have no texture specified
#default
{
texture { pigment {color red 1} finish{ambient 0.2} }
}
@com.------------------------------
@mt2.if
#if (High_Quality)
// This section is parsed if High_Quality is true
#end // End of conditional part
// or
#if (clock > 2)
// This section is parsed if clock is > 2
#else
// This section is parsed if clock is <= 2
#end // End of conditional part
@com.------------------------------
@mt2.ifdef
#ifdef (SphereFlake_Shape)
// This section is parsed if SphereFlake_Shape is declared
#else
// This section is parsed if SphereFlake_Shape is NOT declared
#declare SphereFlake_Shape = sphere {0,1} // make a default shape
#end // End of conditional part
@com.------------------------------
@mt2.switch
// Let's make some constant names
#declare CS_Easy = 1
#declare CS_Medium = 3
#declare CS_Hard = 5
// Let the user choose the method to use
#declare Complexity_Switch = CS_Medium // or CS_Easy or CS_Hard
// Do something dependent on the user's choice
#switch (Complexity_Switch)
#case (CS_Easy)
// This statement is done if (Complexity_Switch = CS_Easy)
#declare MyShape = box{-1,+1}
#break // end of CS_Easy
#case (CS_Medium, CS_Hard)
// This statement is done if Complexity_Switch is CS_Medium
// or CS_Hard or anything in between
#declare MyShape = torus{1, 0.5}
#break // end of CS_Hard
#else
// This statement is done if none of the above match
#declare MyShape = sphere{0,1}
#end
@com.------------------------------
@mt2.while
// Create 10 balls along X axis
#declare BallCount = 0
#while (BallCount < 10)
sphere { <BallCount,0,0>, 0.5 }
#declare BallCount = BallCount+1
#end
@com.------------------------------
@mt2.messages
#debug "During scene parsing, general info message"
#fatal "During scene parsing, display and force POV-Ray to stop"
#render "After scene parsing, about to render"
#statistics "After scene frame is rendered"
#warning "During scene parsing"
#end
@com.------------------------------
@mt2.version
#declare Temp_Vers = version // Save previous value
#version 1.0 // Change to 1.0 mode
// Version 1.0 stuff goes here ...
#version Temp_Vers // Restore previous version
@com.============================================================
@mt1.Shapes
@com.============================================================
@com.------------------------------
@mt2.bicubic_patch
// 3D curved finite surface created from a mesh of triangles
bicubic_patch
{
type 1 // patch_type (0..1)
// 0 = Bezier patch, just store the triangular vertices
// 1 = Bezier patch, store all plane equations defined by
// the triangulation of the patch into sub patches
flatness 0.1 // flatness value
// flatness_value = 0.01 to 1.0, with higher values
// giving flatter, less smooth results
u_steps 3 // # of triangles to subdivide (1-5)
v_steps 3 // # of triangles to subdivide (1-5)
<0, 0, 2> <1, 0, 0> <2, 0, 0> <3, 0, -2>
<0, 1, 0> <1, 1, 0> <2, 1, 0> <3, 1, 0>
<0, 2, 0> <1, 2, 0> <2, 2, 0> <3, 2, 0>
<0, 3, 2> <1, 3, 0> <2, 3, 0> <3, 3, -2>
}
@com.------------------------------
@mt2.box
// create a box that extends between the 2 specified points
box
{
<-1, -1, -1> // one corner position <X1 Y1 Z1>
< 1, 1, 1> // other corner position <X2 Y2 Z2>
}
@com.------------------------------
@mt2.blob
// create a smooth blobby shape
#declare StrengthVal = 1.0 // (+ or -) strength of component's radiating density
#declare RadiusVal = 1.0 // (0 < RadiusVal) outer sphere of influence on other components
blob
{
// threshold (0.0 < threshold <= StrengthVal) surface falloff threshold #
threshold 0.6
sphere { < 0.75, 0, 0>, StrengthVal, RadiusVal }
sphere { <-0.375, 0.65, 0>, StrengthVal, RadiusVal }
sphere { <-0.375, -0.65, 0>, StrengthVal, RadiusVal }
cylinder { -z, +z, 0.1, StrengthVal, RadiusVal }
// [sturm]
scale 2
}
@com.------------------------------
@mt2.cone
// clipped conical shape
// cone { <END1>, RADIUS1, <END2>, RADIUS2 [open] }
// Where <END1> and <END2> are vectors defining the x,y,z
// coordinates of the center of each end of the cone
// and RADIUS1 and RADIUS2 are float values for the radii
// of those ends. open, if present, cone is hollow, else capped
cone
{
1*y, 0.0,
-1*y, 1.0
// open
}
@com.------------------------------
@mt2.cubic
// create a 3rd order polynomial surface
cubic
{
<
// x^3, x^2y, x^2z, x^2,
0, 0, 0, 0,
// xy^2, xyz, xy, xz^2,
0, 0, 0, 0,
// xz, x, y^3, y^2z,
0, 0, 0, 0,
// y^2, yz^2, yz, y,
0, 0, 0, 0,
// z^3, z^2, z, C
0, 0, 0, 0
>
sturm // optional, slower but reduces speckles
}
@mt2.cylinder
// Capped Cylinder, closed [or open ended]
// cylinder { <END1>, <END2>, RADIUS [open] }
// END1 = coord of one end of cylinder
// END2 = coord of other end
// RADIUS = size of cylinder
// open = if present, cylinder is hollow, else capped
cylinder
{
0*x, 3*x, 1
// open
}
@com.------------------------------
@mt2.disc
// disc <center> <normalVector> radius [holeRadius]
disc
{
<0, 1, 0> z,
1.0, // outer radius
0.2 // optional hole radius
}
@com.------------------------------
@mt2.fractal
// create a 3-D slice of a 4-D julia fractal object
julia_fractal
{
<-0.083,0.0,-0.83,-0.025>
quaternion // hypercomplex?
cube // TYPE: sqr cube
max_iteration 8
precision 20 // 10...500? FIXME
// slice xx?
}
@com.------------------------------
@mt2.height_field
// uses image color index as height, extends along X-Z axes
// from <0 0 0> to <1 1 1>
height_field
{
gif // the file type to read (gif/tga/pot/pgm/ppm/png/sys)
"plasma3.gif" // the file name to read
// inverse | texture {...}
// [smooth] // make smoother surface
// [water_level N] // truncate/clip below N (0.0 ... 1.0)
// translate VECTOR | rotate VECTOR | scale VECTOR
}
@com.------------------------------
@mt2.lathe
lathe {
linear_spline // linear_spline | quadratic_spline | cubic_spline
5, // number of points
<2, 0>, <3, 0>, <3, 5>, <2, 5>, <2, 0> // the list of <u,v> points
pigment {Red}
}
@com.------------------------------
@mt2.mesh
// triangle/smooth-triangle mesh shape (example:box)
mesh
{
/* top side */
triangle { <-2, 2, -2>, <2, 2, -2>, <2, 2, 2> texture { Red } }
triangle { <-2, 2, -2>, <-2, 2, 2>, <2, 2, 2> texture { Red } }
/* bottom side */
triangle { <-2, -2, -2>, <2, -2, -2>, <2, -2, 2> }
triangle { <-2, -2, -2>, <-2, -2, 2>, <2, -2, 2> }
/* left side */
triangle { <-2, -2, -2>, <-2, -2, 2>, <-2, 2, 2> }
triangle { <-2, -2, -2>, <-2, 2, -2>, <-2, 2, 2> }
/* right side */
triangle { <2, -2, -2>, <2, -2, 2>, <2, 2, 2> texture { Green } }
triangle { <2, -2, -2>, <2, 2, -2>, <2, 2, 2> texture { Green } }
/* front side */
triangle { <-2, -2, -2>, <2, -2, -2>, <-2, 2, -2> texture { Blue } }
triangle { <-2, 2, -2>, <2, 2, -2>, <2, -2, -2> texture { Blue } }
/* back side */
triangle { <-2, -2, 2>, <2, -2, 2>, <-2, 2, 2> }
triangle { <-2, 2, 2>, <2, 2, 2>, <2, -2, 2> }
texture
{ // remaining triangles get this texture
pigment { color rgb<0.9, 0.9, 0.9> }
finish { ambient 0.2 diffuse 0.7 }
}
}
@com.------------------------------
@mt2.no_shadow
// let light pass through a shape, don't cast a shadow
no_shadow
@com.------------------------------
@mt2.object
#define MyShape = box {-1,1} // define the shape
object { MyShape } // create an actual object with that shape
object { MyShape translate 3*x} // create another object with that shape
@com.------------------------------
@mt2.plane
// create an infinite planar surface
plane
{
y, // <X Y Z> unit surface normal, vector points "away from surface"
-1.0 // distance from the origin in the direction of the surface normal
}
@com.------------------------------
@mt2.polygon
// A complex example for a polygon is the letter "P":
polygon
{
12, // number of points
<0, 0>, <0, 6>, <4, 6>, <4, 3>, <1, 3>, <1, 0>, <0, 0>, // list of <u,v> points
<1, 4>, <1, 5>, <3, 5>, <3, 4>, <1, 4>
}
@com.------------------------------
@mt2.polynomial
// create an Nth order polynomial surface
// poly { N <a,b,c...> [sturm] }
// N = order of poly, M terms where M = (N+1)*(N+2)*(N+3)/6
poly
{
5, // order of polynomial (2...7)
<
// x^5, x^4y, x^4z, x^4,
0, 0, 0, 0,
// x^3y^2, x^3yz, x^3y, x^3z^2,
0, 0, 0, 0,
// x^3z, x^3, x^2y^3, x^2y^2z,
0, 0, 0, 0,
// x^2y^2, x^2yz^2, x^2yz, x^2y,
0, 0, 0, 0,
// x^2z^3, x^2z^2, x^2z, x^2,
0, 0, 0, 0,
// xy^4, xy^3z, xy^3, xy^2z^2,
0, 0, 0, 0,
// xy^2z, xy^2, xyz^3, xyz^2,
0, 0, 0, 0,
// xyz, xy, xz^4, xz^3,
0, 0, 0, 0,
// xz^2, xz, x, y^5,
0, 0, 0, 0,
// y^4z, y^4, y^3z^2, y^3z,
0, 0, 0, 0,
// y^3, y^2z^3, y^2z^2, y^2z,
0, 0, 0, 0,
// y^2, yz^4, yz^3, yz^2,
0, 0, 0, 0,
// yz, y, z^5, z^4,
0, 0, 0, 0,
// z^3, z^2, z, C
0, 0, 0, 0
>
sturm // optional, slower but reduces speckles
}
@com.------------------------------
@mt2.prism
prism {
cubic_spline // linear_spline | quadratic_spline | cubic_spline
linear_sweep // linear_sweep | conic_sweep
-0.5, // height 1
0.5, // height 2
10, // number of points
// the <u,v> points
< 0.2, -1.0>, < 0.2, 0.2>, < 1.0, -0.2>, < 1.0, 0.2>, < 0.2, 1.0>,
<-0.2, 1.0>, <-1.0, 0.2>, <-1.0, -0.2>, <-0.2, 0.2>, <-0.2, -1.0>
// open
// sturm
}
@com.------------------------------
@mt2.quadric
// create a quadratic polynomial surface
quadric
{
<0, 1, 1> // A x^2 + B y^2 + C z^2 +
<1, 0, 0> // D xy + E xz + F yz +
<0, 3, 0> // G x + H y + I z +
2 // J
sturm // optional, slower but reduces speckles
}
@com.------------------------------
@mt2.quartic
// create a 4th order polynomial surface
quartic
{
<
// x^4, x^3y, x^3z, x^3, x^2y^2,
0, 0, 0, 0, 0,
// x^2yz, x^2y, x^2z^2, x^2z, x^2,
0, 0, 0, 0, 0,
// xy^3, xy^2z, xy^2, xyz^2, xyz,
0, 0, 0, 0, 0,
// xy, xz^3, xz^2, xz, x,
0, 0, 0, 0, 0,
// y^4, y^3z, y^3, y^2z^2, y^2z,
0, 0, 0, 0, 0,
// y^2, yz^3, yz^2, yz, y,
0, 0, 0, 0, 0,
// z^4, z^3, z^2, z, C
0, 0, 0, 0, 0
>
sturm // optional, slower but reduces speckles
}
@com.------------------------------
@mt2.smooth_triangle
// rounded-surface triangle (don't try this at home!)
smooth_triangle
{
< 0, 30, 0> <0, 0.7071, -0.7071> // <Vertex1> <SurfaceNormal1>
< 40, -20, 0> <0, -0.8664, -0.5> // <Vertex2> <SurfaceNormal2>
< 0, 0, 0> <0, -0.5, -0.8664> // <Vertex3> <SurfaceNormal3>
}
@com.------------------------------
@mt2.Surface of Revolution
// create a Surface of Revolution shape (like lathe, but faster)
sor
{
7, // # of points
<0.000000, 0.000000> // list of <u,v> points
<0.118143, 0.000000>
<0.620253, 0.540084>
<0.210970, 0.827004>
<0.194093, 0.962025>
<0.286920, 1.000000>
<0.468354, 1.033755>
open
}
@com.------------------------------
@mt2.sphere
// create a sphere shape
sphere
{
<0, 0, 0> // center of sphere <X Y Z>
2.0 // radius of sphere
}
@com.------------------------------
@mt2.superellispoid
// create a superquadric ellipsoid shape
superellipsoid
{
0.5, // east-west exponent (0.0 ... 1.0)
1.0, // north-south exponent (0.0 ... 1.0)
}
@com.------------------------------
@mt2.text
// create a TrueType text shape
text
{
ttf // font type (only TrueType for now)
"cour.ttf", // Microsoft Windows-format TrueType font file name
"POV-Ray", // the string to create
2, // the extrusion depth
0 // ?? FIXME
}
@com.------------------------------
@mt2.torus
// torus MAJOR, MINOR (in the X-Z plane)
// MAJOR = float value giving the major radius
// MINOR = float specifying the minor radius
// The major radius extends from the center of the hole
// to the mid-line of the rim while the minor radius
// is the radius of the cross-section of the rim.
torus { 1.0, 0.2 }
@com.------------------------------
@mt2.triangle
// triangular surface (vertices are endpoints)
triangle
{
<-1, 0, -1> // <Vertex1>
< 1, 0, -1> // <Vertex2>
< 0, 0, 1> // <Vertex3>
}
@com.============================================================
@mt1.Shape modifiers
@com.============================================================
@com.------------------------------
@mt2.bounded_by
// set an outer proposed boundary for parent object(s)
// allows the ray-tracer to do a quick check on the Bounding Shape,
// and if outside, it skips checking this object. Note that this
// is not a 100% guaranteed clipping shape... use the
// clipped_by statement for that.
bounded_by { box { -(x+y+z) +(x+y+z) }
@com.------------------------------
@mt2.clipped_by
// set clipping shape for parent object.
// (parent shape will not extend beyond ClipShape bounds)
clipped_by { sphere { 0*x, 1.0 } }
@com.------------------------------
@mt2.hollow
// allow atmosphere inside shape
hollow
@com.------------------------------
@mt2.no_shadow
// give object no shadow
no_shadow
@com.============================================================
@mt1.CSG operations
@com.============================================================
@com.------------------------------
@mt2.difference
// CSG difference, subtract intersections of shapes 2...N from Shape1
difference
{
Shape1 {...} // Start with this shape
Shape2 {...} // This will be "cut out" of Shape1
ShapeN {...} // This will be "cut out" of Shape1
}
@com.------------------------------
@mt2.intersection
// CSG intersection, the common space where all the shapes meet
intersection
{
Shape1 {...}
Shape2 {...}
ShapeN {...}
}
@com.------------------------------
@mt2.inverse
// flip an object's inside and outside for intersect/difference
intersection
{
Shape1 {...}
Shape2 {... inverse }
}
@com.------------------------------
@mt2.merge
// CSG merge, merge all of shapes 1...N
// like ╥union╙, but no overlap seam lines
merge
{
Shape1 {...}
Shape2 {...}
ShapeN {...}
}
@com.------------------------------
@mt2.union
// CSG union, add all of shapes 1...N
union
{
Shape1 {...}
Shape2 {...}
ShapeN {...}
}
@com.============================================================
@mt1.Transformations
@com.============================================================
@mt2.matrix
// Matrix is an object transformation that does rotation about the Y axis,
// shear along the Y axis, and translation along the Y axis
matrix
<
0.886, 0.5, 0.5,
0, 1, 0,
0.5, 0, -0.886,
0, 1.5, 0
>
@com.------------------------------
@mt2.rotate
// rotate shape or texture around <0 0 0>, relative to current orientation
// example: rotate 30*x
rotate <45, 45, 0> // <dX dY dZ> (in degrees)
@com.------------------------------
@mt2.scale
// "resize" an object or texture relative to its current size
// example: scale 2.0
scale <1.0, 2.0, 1.0> // <dX dY dZ>
@com.------------------------------
@mt2.translate
// Move object or texture relative to current position
// example: translate -5.0*z
translate <2.0, 4.0, -1.0> // <dX dY dZ>
@com.------------------------------
@mt2.Transform
// object/texture transformation
// do a predeclared translate/rotate/scale combo
// e.g.:
#declare Leaf_Orientation = transform { scale 4.0 rotate 30*z translate 2*y }
transform Leaf_Orientation // transform an object
@com.============================================================
@mt1.Textures
@com.============================================================
@com.------------------------------
@mt2.texture
texture
{
pigment
{
marble // some pattern
// optional color_map
turbulence 0.5
scale <1,3,1>// translformations
}
// halo { }
normal
{
marble // some pattern
turbulence 0.5
scale <1,3,1>// translformations
}
finish
{
ambient 0.2
specular 0.6
}
}
@com.------------------------------
@mt2.agate
// texture pattern
agate // use an agate-like texture
agate_turb 0.3 // can alter turbulence [1.0]
// color_map {...} // optional color map
@com.------------------------------
@mt2.ambient
// texture finish {} attribute
ambient 0.2 // set ambient surface reflection (0...1) [0.1]
@com.------------------------------
@mt2.Attenuation
// texture finish attribute
fade_distance FADE_DISTANCE
fade_power FADE_POWER
@com.------------------------------
@mt2.bozo
// texture pattern
bozo // use color map to swirl colors
// turbulence 0.3
// color_map...
@com.------------------------------
@mt2.brick
// texture pattern
pigment
{
brick color Red, color Gray
brick_size <2,1,1> // size of brick
mortar 0.2 // width of mortar
}
@com.------------------------------
@mt2.brilliance
// texture finish {} attribute
brilliance 0.5 // tightness of diffuse illumination
@com.------------------------------
@mt2.bumps
// texture normal {} attribute
bumps 0.3 // bumpy surface (0...1)
@com.------------------------------
@mt2.caustics
// texture finish attribute
caustics POWER
@com.------------------------------
@mt2.checker
// texture pattern
// square checker pattern, alternates color1 and color2
// checkers are in the X-Z plane, extending infinitely in Y plane
checker
color red 1 green 1 blue 1
color red 0 green 1 blue 0
@com.------------------------------
@mt2.color
// texture pigment {} attribute
// RGB values can range from 0.0 (dark) to 1.0 (saturated)
color red 0.5 green 0.5 blue 0.5 // filter 0.8
@com.------------------------------
@mt2.color_map
// texture pigment {} attribute
// create a smooth color gradation map
color_map
{
// [ END_VAL color red R green G blue B filter F transmit T]
// -or old style-
// [ START_VAL END_VAL color red R green G blue B filter F color red R green G blue B filter F]
[ 0.1 color red 0.0 green 0.0 blue 0.0]
[ 0.3 color red 0.8 green 0.4 blue 0.2]
[ 0.5 color red 0.0 green 0.0 blue 0.0]
[ 0.7 color red 0.0 green 0.0 blue 0.8 filter 0.5]
[ 1.0 color red 0.8 green 0.8 blue 0.8 filter 1.0]
} // color_map
@com.------------------------------
@mt2.crackle
// texture pattern
crackle 0.5 turbulence 0.5
@com.------------------------------
@mt2.crand
// texture finish {} attribute
// randomly speckle the surface
// Note, this is truly random, and looks BAD in animations
crand 0.2
@com.------------------------------
@mt2.dents
// texture normal attribute
dents 0.6 // dented surface (0...1) [0.0]
@com.------------------------------
@mt2.diffuse
// texture finish attribute
diffuse 0.6 // amount of diffuse lighting (0...1) [0.6]
@com.------------------------------
@mt2.finish
// texture statement
finish { ambient 0.2 specular 0.5 reflection 0.2 }
@com.------------------------------
@mt2.frequency
// texture pigment/normal attribute
frequency 2.0 // oscillation freq. of radial, ripples, waves, etc
@com.------------------------------
@mt2.gradient
// texture pigment/normal attribute
gradient x+y // specify color_map direction(s)
// color_map {...} // requires a color map
@com.------------------------------
@mt2.granite
// texture pigment attribute
granite // create a granite-like texture
// color_map {...} // optional color map
@com.------------------------------
@mt2.halo
// texture component
/*
halo {
attenuating | emitting | glowing | dust
[ constant | linear | cubic | poly ]
[ planar_mapping | spherical_mapping |
cylindrical_mapping | box_mapping ]
[ dust_type DUST_TYPE ]
[ eccentricity ECCENTRICITY ]
[ max_value MAX_VALUE ]
[ exponent EXPONENT ]
[ samples SAMPLES ]
[ aa_level AA_LEVEL ]
[ aa_threshold AA_THRESHOLD ]
[ jitter JITTER ]
[ turbulence <TURBULENCE> ]
[ octaves OCTAVES ]
[ omega OMEGA ]
[ lambda LAMBDA ]
[ colour_map COLOUR_MAP ]
[ frequency FREQUENCY ]
[ phase PHASE ]
[ scale <VECTOR> ]
[ rotate <VECTOR> ]
[ translate <VECTOR> ]
}
*/
halo
{
dust
dust_type 2
constant
spherical_mapping
max_value 1.0
colour_map
{
[ 0 color rgbf <1, 1, 1, 0.0> ]
[ 1 color rgbf <1, 1, 1, 0.1> ]
}
samples 100
aa_level 5
aa_threshold 0.1
jitter 0.8
}
@com.------------------------------
@mt2.hexagon
// texture pigment attribute
// create a hexagonal pattern texture with 3 colors
// hexagons are in the X-Z plane, extending infinitely in Y plane
hexagon
color blue 1
color red 1
color green 1
@com.------------------------------
@mt2.irid
// texture finish {} attribute
// irid { AMOUNT thickness THICKNESS turbulence TURBULENCE }
irid { 0.8 thickness 0.2 turbulence 1.0 }
@com.------------------------------
@mt2.ior
// texture finish {} attribute
// 1.0=air, 1.33=water, 1.5=glass, 2.4=diamond (see also IOR.INC)
ior 1.3 // index of refraction
@com.------------------------------
@mt2.lambda
// texture pigment/normal attribute
// change surface perturbation property
// makes turbulence more "swirly"
lambda 1.2 // (1.0...5.0) [2.0]
@com.------------------------------
@mt2.leopard
// texture pigment/normal attribute
leopard // create a leopard spotted texture
// color_map {...} // optional color map
@com.------------------------------
@mt2.mandel
// texture pigment/normal attribute
// create a mandelbrot fractal surface in the X-Y plane
mandel 50 // (2...1000) [256]
// scale <...> translate <...> // zoom and move
// color_map {...} // requires a color map
@com.------------------------------
@mt2.marble
// texture pigment/normal attribute
marble // create a marble-like texture
// turbulence 1.0 // should have some!
// color_map {...} // uses a color map
@com.------------------------------
@mt2.metallic
// texture finish attribute
// use surface color, not light source color for phong hilights
metallic on // on/off
@com.------------------------------
@mt2.normal
// texture statement
normal { wrinkles 0.5 scale 0.5 }
@com.------------------------------
@mt2.octaves
// texture pigment/normal attribute
// increases the "folds" in turbulence changes
octaves 3 // (1...10) [6]
@com.------------------------------
@mt2.omega
// texture pigment/normal attribute
// change surface perturbation property
// makes turbulence more "krinkly"
omega 1.2 // (0.0...2.0) [0.5]
@com.------------------------------
@mt2.onion
// texture pigment/normal attribute
onion // create an onion-like concentric circle texture
// color_map {...} // requires a color map
@com.------------------------------
@mt2.phase
// texture pigment/normal attribute
// change the phase of ripples, etc.
// Animation note: As phase DECREASES, ripples move OUTWARD.
phase 0.5
@com.------------------------------
@mt2.phong
// texture finish attribute
// add phong hilighting to surface (0...1)
phong 0.8
@com.------------------------------
@mt2.phong_size
// texture finish attribute
// set the size of the phong spot (1...250) [40]
// 20=dull rubber, 40=plastic, 200=shiny glass
phong_size 80
@com.------------------------------
@mt2.quick_color
// texture pigment attribute
quick_color green 1 // low-quality quick-render color
@com.------------------------------
@mt2.quilted
// texture normal attribute
// creates a pattern like a quilt
quilted 0.4 // amount
control0 -1 // lower curvature (-1...1)
control1 1 // upper curvature (-1...1)
@com.------------------------------
@mt2.radial
// texture pattern
// radially projected color_map in X-Z
radial
// frequency 4.0 // increases # of color "spokes"
// color_map ...
@com.------------------------------
@mt2.reflection
// texture finish {} attribute
reflection 0.3 // amount of surface reflection (0...1) [0]
@com.------------------------------
@mt2.refraction
// texture finish {} attribute
// turn this on (1) if using "filter" in pigment colors
refraction 1 // amount of pass-through light (0 or 1) [0]
@com.------------------------------
@mt2.ripples
// texture normal {} attribute
ripples 0.5 // make surface ripply (0...1)
@com.------------------------------
@mt2.roughness
// texture finish {} attribute
// alters specular hilighting
roughness 0.01 // 1.0=rough, 0.001=smooth [0.05]
@com.------------------------------
@mt2.specular
// texture finish {} attribute
// Note: size of hilight depends on roughness attribute
specular 0.7 // use specular hilighting on surface (0...1) [0]
@com.------------------------------
@mt2.spiral1
// texture pattern
spiral1 5
@com.------------------------------
@mt2.spiral2
// texture pattern
spiral2 5, 0.6
@com.------------------------------
@mt2.spotted
// texture finish {} attribute
spotted // create a spotted texture
// color_map {...} // requires a color map
@com.------------------------------
@mt2.tiles
// texture attribute
// create a tiled texture, alternates between 2 full textures
tiles
{
texture // texture of tile #1
{
pigment { agate scale 0.3 }
}
tile2
texture // texture of tile #2
{
pigment { granite }
}
} // tiles
@com.------------------------------
@mt2.turbulence
// texture pigment/normal attribute
// Takes a float or vector, see also octaves, omega, lambda, frequency
turbulence <0, 1, 0.5> // how much to ╥stir up╙ the texture (0...1 or more)
@com.------------------------------
@mt2.warp
// texture pigment modifier
warp { turbulence 0.4*x octaves 2 repeat x*2 flip y offset z*0.25 }
@com.------------------------------
@mt2.waves
// texture normal attribute
// create a wavy surface (also use phase)
waves 0.5
@com.------------------------------
@mt2.wood
// texture pigment {} attribute
// create a concentric cylindrical wood-like texture,
// grain along Z axis
wood
// turbulence 0.1 // should have some!
// color_map {...} // optional color map
@com.------------------------------
@mt2.wrinkles
// texture normal {} attribute
// create a wrinkly surface (0...1 or more)
wrinkles 0.5
@com.------------------------------
@mt2.irid
// texture finish attribute
irid { 0.8 // amount of iridescence saturation (0...1) [0]
// thickness N.N
// turbulence 0.N
}
@com.============================================================
@mt1.Texture Colors
@com.============================================================
@com.------------------------------
@mt2.blue
color blue 1
@com.------------------------------
@mt2.filter
color red 1 filter 1
@com.------------------------------
@mt2.green
color green 1
@com.------------------------------
@mt2.red
color red 1
@com.------------------------------
@mt2.transmit
color green 1 transmit 1
@com.------------------------------
@mt2.rgb
// rgb - Red Green Blue color shortcut
color rgb <0.2, 0.3, 0.4>
@com.------------------------------
@mt2.rgbf
// rgbf - Red Green Blue Filter color shortcut
color rgbf <0.2, 0.3, 0.4, 0.9>
@com.------------------------------
@mt2.rgbft
// rgbft - Red Green Blue Filter Transmit color shortcut
// NOTE: filter + transmit should always equal 1.0
color rgbft <0.5, 0.5, 0.5, 0.4, 0.6>
@com.------------------------------
@mt2.color components
// extract each component of a color:
// #if (MyColor.red < 0.5) ...
// #if (MyColor.green < 0.5) ...
// #if (MyColor.blue < 0.5) ...
// #if (MyColor.filter < 0.5) ...
// #if (MyColor.transmit < 0.5) ...
@com.============================================================
@mt1.Texture Image Maps
@com.============================================================
@com.------------------------------
@mt2.bump_map
// texture normal {} attribute
// create a texture that has a bumpiness corresponding to color index
// image maps into X-Y plane from <0,0,0> to <1,1,0>
bump_map
{ // uses image color or index as bumpiness
gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
// [use_color | use_index]
// [once]
bump_size 0.5 // 0...3
} // bump_map
@com.------------------------------
@mt2.Image_map
// texture pigment {} attribute
// create a texture that lays an image's colors onto a surface
// image maps into X-Y plane from <0,0,0> to <1,1,0>
image_map
{
gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
// [filter N V] // N=all or color index # (0...N), V= value (0.0...1.0)
// [transmit N V] // N=all or color index # (0...N), V= value (0.0...1.0)
// [use_color | use_index]
// [once]
} // image_map
@com.------------------------------
@mt2.Material_map
// texture attribute
// create a texture that maps different textures onto different color indexes
// image maps into X-Y plane from <0,0,0> to <1,1,0>
material_map
{
gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
// [once]
texture { pigment {wood} } // texture for color index # 0
texture { pigment {granite} } // texture for color index # 1
texture { pigment {agate} } // texture for color index # 2
// etc...
} // material_map
@com.============================================================
@mt1.Std colors
@com.============================================================
@mt2."Colors.inc"
// Standard pre-defined colors
#include "colors.inc"
@com.============================================================
@mt1.Ready-Made Scenes
@com.============================================================
@com.------------------------------
@mt2.Checkered floor
@com.------------------------------
@mt2.Image Map
@com.------------------------------
@mt2.Height-field logo
@com.
@com.============================================================
@com.end of file is next
@@@@